﻿package org.openChart.display 
{
	import flash.events.KeyboardEvent;
	import flash.geom.Point;
	import org.openChart.meta.Stick;
	
	/**
	 * ...
	 * @author Chongyuan
	 */
	public class DisplayStick extends DisplayBaseObject
	{
		private var startPosition_:Point;
		private var endPosition_:Point;
		private var width_:uint;
		private var height_:Number;
		//private var color_:uint;
		private var showLine_:Boolean;
		private var stickLine_:DisplayStickLine;
		public function DisplayStick( stick:Stick ) 
		{
			startPosition = new Point();
			endPosition = new Point();
			this.showLine = stick.showStickLine;
			//this.color = stick.getStyle().color;
			this.width_ = stick.getStyle().width;
			this.height_ = stick.getStyle().height;
			super(stick);
		}
		
		public function get startPosition():Point
		{
			return this.startPosition_;
		}
		
		public function set startPosition( startPosition_:Point ):void
		{
			this.startPosition_ = startPosition_;
		}
		
		public function get endPosition():Point
		{
			return this.endPosition_;
		}
		
		public function set endPosition( endPosition_:Point ):void
		{
			this.endPosition_ = endPosition_;
		}
		
		public function get width():Number
		{
			return this.width_;
		}
		
		public function set width( width_:Number ):void
		{
			this.width_ = width_;
		}
		
		public function get showLine():Boolean
		{
			return this.showLine_;
		}
		
		public function set showLine( showLine_:Boolean ):void
		{
			this.showLine_ = showLine_;
		}
		
		public function get stickLine():DisplayStickLine
		{
			return this.stickLine_;
		}
		
		public function set stickLine( stickLine_:DisplayStickLine ):void
		{
			this.stickLine_ = stickLine_;
		}
		
		public function get height():Number
		{
			return height_;
		}
		
		public function set height(height_:Number):void
		{
			this.height_ = height_;
		}
		
		public function toString():String
		{
			var str:String = "\nDisplayStick ";
			str += "[height = " + height + "]";
			str += "[showLine = " + showLine + "]";
			str += "[width = " + width + "]";
			str += "[startPosition: x = " + startPosition.x + ", y = " + startPosition.y + "]";
			str += "[endPosition: x = " + endPosition.x + ", y = " + endPosition.y + "]";
			str += "[stickline = " + stickLine + "]";
			return str;
		}
	}
	
}